<!--九宫格图片上传-->
<template>
  <view
    class="uploadGrid"
    v-if="newMediaType.length == 1 && newMediaType[0] == 'video'"
  >
    <view class="grid-item">
      <img
        class="grid-item-delete"
        @tap="handleDelete"
        :data-index="index"
        v-if="item != defaultImg"
        src="https://ltcx-img.oss-cn-beijing.aliyuncs.com/miniprogram/common/delete.png"
      />
      <video class="grid-item-pic" :src="imgs[0]" :controls="true"/>
    </view>
  </view>
  <!-- <video
    id="myVideo"
    src="https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/2minute-demo.mp4"
    controls
  ></video> -->

  <view class="uploadGrid" v-else>
    <block v-for="(item, index) in imgs" :key="index">
      <view class="grid-item">
        <img
          class="grid-item-delete"
          @tap="handleDelete"
          :data-index="index"
          v-if="item != defaultImg"
          src="https://ltcx-img.oss-cn-beijing.aliyuncs.com/miniprogram/common/delete.png"
        />
        <view
          class="grid-item-pic flex-column-content-center"
          :data-index="index"
          @tap="chooseMedia"
        >
          <view v-if="index < count && item == defaultImg">
            <img class="default-img" :src="defaultImg" />

            <view class="upload">上传图片</view>
          </view>

          <img :class="['grid-item-pic']" :src="item" v-else/>
        </view>
      </view>
    </block>
  </view>
</template>
<script src="./indexMod.js">
</script>
<style src="./indexStyle.scss">
</style>